$('.right-titleicon').on("click", function(e) {
	projectVM.showMenulist()
})
document.addEventListener('focusout', function(e) {
	var classList = document.body.classList
	if (classList.contains('mui-focusin')) {
		classList.remove('mui-focusin')
	}
})
projectVM = new Vue({
	el: "#content",
	data: {
		checkResultTypeList: [], //复选框字典类型
		searchParams: {},
		loading: false,
		showTabs: 'collectableTask', // tab页默认选择
		currentUser: '', //当前登录用户
		questionArrary: [], //缺陷记录
		parentObject: {},
		stepList: [],
		active: "",
		workType: '',
		nodeLogList: [],
		isShow: false,
		showCheck: false, //显示审批人
		showDes: true, //显示
		filesList:[],
		backOrAgree: '', //点击通过还是退回打开弹窗
		isSaveVisable: false, //是否显示保存按钮
		isSubVisable: false, //是否显示提交按钮
		isBackVisable: false, //是否显示退回按钮
		isPassVisable: false, //是否显示通过按钮
		isBrandAdd: false, //面包屑显示
		isBrandCheck: false,
		workInfo: {},
		isView: false, //是否可编辑
		checkPersonList: [], //检查人数组
		checkList: [], //接收检查内容数组向后台传递
		checkPerson: '', //多个检查人
		submitSwitch: {
			questionArrary: [],
			confirmPerson: '',
			desc: '',
			confirmPersonCode: [],
			confirmPersonName: [],
			strCode: '',
			strName: ''
		},
		safeCheck: { //安全设施检查
			safetyFacilityCheckId: '', //安全设施检查记录主键
			workId: '', //工作主键
			workDesc: '', //工作描述
			checkTime: '', //检查时间
			checkStaffCode: '', //检查人编号
			checkStaffName: '', //检查人姓名
			checkArea: '', //检查区域
			remark: '', //备注
			client: '', //客户ID
			dataSource: 'NEIOS_APP'+localStorage.getItem("currVersion"), //数据来源
			status: '', //业务状态
			dataStatus: '', //是否有效参见码表0删除&1正常
			createBy: '', //创建人员
			createStaffName: '', //创建人姓名
			create: '', //创建时间
			modifyBy: '', //修改人员
			modifyStaffName: '', //修改人员姓名
			modify: '', //修改时间
			reserveField1: '', //扩展字段1
			reserveField2: '', //扩展字段2
			reserveField3: '', //扩展字段3
			reserveField4: '', //扩展字段4
			reserveField5: '', //扩展字段5
			checkItems: [], //检查项
		},
		isApprove: false,
		disabled: false,
		showAdd: false,
		fileIds:'',
		checkItem: {
			checkItemNoteId: '', //检查项记录主键
			busiInfoId: '', //业务明细主键,检查项记录对应的业务明细记录的主键
			configDetailedId: '', //检查项主键
			checkItemConfigId: '',
			orgCode: '', //机构编号
			checkItemContent: '', //检查项内容
			workType: '',
			checkItemRequirement: '', //检查项要求
			checkItemResult: '', //检查结果
			createBy: '',
			createStaffName: '',
			itemSolveStaffCode: '', //检查消除人编号
			itemSolveStaffName: '',
			problemLog: '', //发现问题记录
			modifyBy: '',
			modifyStaffName: '', //检查消除人姓名
			headquartersDetailedId: '', //总部检查项主键,分公司修改总部检查项时记录总部检查项主键
			parentDetailedId: '', //分组父级检查项主键,安全设施检查记录使用
			remark: '' //备注
		},
	},
	components: {
		personselect,
		processlog
	},
	created() {
		console.log(localStorage.getItem('neiosUser'))
		console.log(localStorage.getItem('todoWork'))
		// this.baseForm = Object.assign({}, JSON.parse(localStorage.getItem('todoWork')).obj)
		// this.cfmData = { // 确认框数据
		// 		workStatus: JSON.parse(localStorage.getItem('todoWork')).obj.workStatus, // 当前节点

		// 		workDesc: JSON.parse(localStorage.getItem('todoWork')).obj.workDesc,
		// 		workId: JSON.parse(localStorage.getItem('todoWork')).obj.workId,
		// 		type: '', // 推进类型（forward：向前、backward：向后）
		// 		// 显示内容
		// 		defectList: [], // 缺陷描述列表
		// 		approver: '', // 审核人
		// 		opinion: '', // 意见描述
		// 		deviceNum: 0 // 已检查设备数量
		// 	},
		this.parentObject = JSON.parse(localStorage.getItem('todoWork')).obj;
		this.workType = JSON.parse(localStorage.getItem('todoWork')).obj.workType
		this.workId = JSON.parse(localStorage.getItem('todoWork')).obj.workId
		this.workStatus = JSON.parse(localStorage.getItem('todoWork')).obj.workStatus
		this.currentUser = JSON.parse(localStorage.getItem('neiosUser'))
		this.active = JSON.parse(localStorage.getItem('todoWork')).obj.workStatus
		let dictCodes = 'YES_OR_NO';
		let dict = mui.neiosCommon.queryDict(dictCodes, (data) => {
			if (data != '') {
				this.checkResultTypeList = data.YES_OR_NO;
				console.log(JSON.stringify(this.checkResultTypeList))
			}
		})
		this.safeCheck.checkTime = this.getTime(new Date(), 'day');
		this.safeCheck.workId = this.workId
		this.getCheckItems(this.workId)
		this.getCheckPerson(this.workId)
		if(this.workStatus>'20'){
			this.disabled = true
		}
	},
	beforeDestroy() {},
	methods: {
		//获取检查人
		getCheckPerson(workId) {
			let _this = this;
			let params = {
				workId: workId
			};
			mui.neiosRequst.httpRequst('//app/regularWork/safeDevice/getCheckPerson', params,
				(data) => {
					if (data.code == '0') {
						_this.checkPersonList = data.data;
						for (let i = 0; i < _this.checkPersonList.length - 1; i++) {
							for (let j = i + 1; j < _this.checkPersonList.length; j++) {
								if (_this.checkPersonList[i].nodeDealStaffCode == _this.checkPersonList[j].nodeDealStaffCode) {
									_this.checkPersonList.splice(j, 1);
								}
							}
						}
						_this.checkPersonList.map(v => {
							_this.safeCheck.checkStaffCode = `${_this.safeCheck.checkStaffCode},${v.nodeDealStaffCode}`;
							_this.safeCheck.checkStaffName = `${_this.safeCheck.checkStaffName},${v.nodeDealStaffName}`;
							_this.checkPerson = `${_this.checkPerson},[${v.nodeDealStaffCode}]${v.nodeDealStaffName}`;
						})
						_this.safeCheck.checkStaffCode = _this.safeCheck.checkStaffCode.substring(1);
						_this.safeCheck.checkStaffName = _this.safeCheck.checkStaffName.substring(1);
						_this.checkPerson = _this.checkPerson.substring(1);
					}
				},
				(data) => {
					mui.toast("获取数据错误：" + data.msg);
				}
			);
		},
		//新增检查项目
		addCheckProject: function() {
			let configDetailedId = mui.neiosCommon.getUuidv4();
			this.safeCheck.checkItems.push({
				checkItemNoteId: mui.neiosCommon.getUuidv4(),
				busiInfoId: this.safeCheck.safetyFacilityCheckId,
				configDetailedId: configDetailedId,
				workType: '0111',
				orgCode: this.currentUser["stationCode"],
				isAdd: false,
				activeName: 'addCheck',
				name: 'addCheck',
				checkItemContent: '',
				checkItemNotes: [{
					checkItemNoteId: mui.neiosCommon.getUuidv4(),
					busiInfoId: this.safeCheck.safetyFacilityCheckId,
					configDetailedId: mui.neiosCommon.getUuidv4(),
					workType: '0111',
					orgCode: this.currentUser["stationCode"],
					checkItemResult: '',
					isAdd: true,
					addOrDelete: false,
					checkItemContent: '',
					problemLog: '',
					remark: '',
					parentDetailedId: configDetailedId,
					selectArr: [],
					selectCodeArr: []
				}]
			});
		},
		//删除检查项目
		deleteCheckProject: function(index) {
			this.safeCheck.checkItems.splice(index, 1);
		},
		//新增检查内容
		addCheckContent: function(index, indexs) {
			this.safeCheck.checkItems[index].checkItemNotes.push({
				checkItemNoteId: mui.neiosCommon.getUuidv4(),
				busiInfoId: this.safeCheck.safetyFacilityCheckId,
				configDetailedId: mui.neiosCommon.getUuidv4(),
				workType: '0111',
				orgCode: this.currentUser["stationCode"],
				checkItemResult: '',
				isAdd: true,
				addOrDelete: false,
				checkItemContent: '',
				problemLog: '',
				remark: '',
				parentDetailedId: this.safeCheck.checkItems[index].configDetailedId,
				selectArr: [],
				selectCodeArr: []
			});
			this.safeCheck.checkItems[index].checkItemNotes[indexs].addOrDelete = true;
			this.safeCheck.checkItems[index].checkItemNotes[indexs].isAdd = false;
		},
		//删除检查内容
		deleteCheckContent: function(index, indexs) {
			this.safeCheck.checkItems[index].checkItemNotes.splice(indexs, 1);
		},
		//获取检查项列表
		getCheckItems(workId) {
			let params = {
				"companyCode": this.currentUser["companyCode"],
				"stationCode": this.currentUser["stationCode"],
				"workType": this.workType,
				"workId": workId
			}

			mui.neiosRequst.httpRequst('/app/regularWork/safeDevice/getCheckItems', params,
				(data) => {
					if (data.code == '0') {
						// console.log(JSON.stringify(data.data.data))
						this.safeCheck.checkItems = data.data.data.resultSafeCheckVoList;
						this.safeCheck.safetyFacilityCheckId = data.data.data.safetyFacilityCheck.safetyFacilityCheckId;
						this.safeCheck.checkArea = data.data.data.safetyFacilityCheck.checkArea;
						this.fileIds = data.data.data.attachIds;
						this.getFileds()
						this.attachIds = data.data.data.attachIds;
						for (let index = 0; index < this.safeCheck.checkItems.length; index++) {
							let element = this.safeCheck.checkItems[index];
							if (element.checkItemResult == null) {
								element.checkItemResult == '';
							}
						}
						this.safeCheck.checkItems.map((v, i) => {
							v.activeName = i;
							v.name = i;
							v.isAdd = true; //是否是新增项目
							v.checkItemNotes.map((item) => {
								if (item.checkItemResult == '' || item.checkItemResult == null) {
									item.selectArr = [];
									item.selectCodeArr = [];
								}
								if (item.checkItemResult == '1') {
									item.selectArr = ['是'];
									item.selectCodeArr = ['1'];
								}
								if (item.checkItemResult == '0') {
									item.selectArr = ['否'];
									item.selectCodeArr = ['0'];
								}
								item.isAdd = false; //新增内容按钮不显示
								item.addOrDelete = false; //删除内容按钮不显示
								item.isRequired = ''; //问题记录默认没有*
								item.isNes = 'notNull'; //问题记录默认不触发校验
							})
						});
					}
				},
				(data) => {
					mui.toast("获取数据错误：" + data.msg);
				}
			);
		},
		submitOk() {
			let _this = this;
			if (this.$refs.personselect.personids) {
				_this.safeCheck = _this.buildSaveParam(_this.safeCheck);
				_this.safeCheck.status = '32';
				_this.safeCheck.workDesc = "对安全设施检查结果进行审核";
				_this.safeCheck.checkItems.map((va) => {
					_this.buildSaveParam(va)
					va.status = '32';
					va.checkItemNotes.map((val) => {
						_this.buildSaveParam(val);
						val.status = '32';
						_this.checkList.push(val);
					})
				});
				_this.checkList = _this.checkList.concat(_this.safeCheck.checkItems);
				let params = {
					"safeCheck": _this.safeCheck,
					"checkList": _this.checkList,
					"fileIds": _this.fileIds,
					"areaCompanyCode": _this.currentUser["companyCode"],
					"stationCode": _this.currentUser["stationCode"],
					"approveCode": this.$refs.personselect.personids,
					"approveName": this.getName(this.$refs.personselect.person),
					"workType": this.workType,
					"questiontArr": _this.questionArrary,
					"currentUser": _this.currentUser
				}
				console.log("提交数据:"+JSON.stringify(params))
				mui.neiosRequst.httpRequst('/app/regularWork/safeDevice/submitSafeCheck', params,
					(data) => {
						console.log("提交返回："+JSON.stringify(data))
						
						if (data.code == '0') {
							mui.toast("提交成功");
							setTimeout(this.goBack(), 500);
						}else{
							mui.toast(data.msg);
						}
					},
					(data) => {
						console.log("提交失败返回："+JSON.stringify(data))
						mui.toast("提交失败：" + data.msg);
					}
				);
			} else {
				mui.toast("请选择审批人");
			}

			// submitSafeCheck(params).then((result) => {
			// 	if (result.data.code == "0") {
			// 		_this.$message({
			// 			message: _this.$t('提交成功'),
			// 			type: 'success'
			// 		})
			// 		_this.loading.close();
			// 		_this.back();
			// 	} else {
			// 		_this.$message({
			// 			message: _this.$t('提交失败'),
			// 			type: 'error'
			// 		})
			// 		_this.loading.close();
			// 	}
			// }).catch((error) => {
			// 	_this.$message({
			// 		message: _this.$t('提交失败'),
			// 		type: 'error'
			// 	})
			// 	_this.loading.close();
			// })
		},
		//点击确定
		submitForm() {
			let _this = this;
			// alert(_this.backOrAgree)
			if (_this.backOrAgree == 'submit') {
				this.submitOk(_this.submitSwitch.strCode, _this.submitSwitch.strName)
			} else {
				if (_this.backOrAgree == 'back') {
					_this.sendConfirmBack();
				} else {
					_this.passConfirm();
				}
			}
		},
		// 通过
		passConfirm: function() {
			let _this = this;
			let param = {
				"workId": _this.workInfo.workId,
				"workType": _this.workInfo.workType,
				"workDesc": _this.workInfo.workDesc,
				"companyCode": _this.currentUser.companyCode,
				"stationCode": _this.currentUser.stationCode,
				"approveDes": _this.submitSwitch.desc,
				"currentUser": _this.currentUser
			};
			console.log("安全参数:"+JSON.stringify(param))
			mui.neiosRequst.httpRequst('/app/regularWork/safeDevice/approveSafeCheck', param,
				(data) => {
					
					if (data.code == '0') {
						mui.toast("通过成功");
						setTimeout(this.goBack(), 500);
					}else{
						mui.toast(data.msg);
					}
					
				},
				(data) => {
					mui.toast("通过失败：" + data.msg);
				}
			);
			// approveSafeCheck(param).then((result) => {
			// 	if (result.data.code == "0") {
			// 		_this.$message({
			// 			message: _this.$t('提交通过成功'),
			// 			type: 'success'
			// 		});
			// 		_this.loading.close();
			// 		_this.$router.go(-1);
			// 	} else {
			// 		_this.$message({
			// 			message: _this.$t('提交通过失败'),
			// 			type: 'error'
			// 		});
			// 		_this.loading.close();
			// 	}
			// }).catch(function() {
			// 	_this.$message({
			// 		message: _this.$t('提交通过失败'),
			// 		type: 'error'
			// 	});
			// 	_this.loading.close();
			// });
		},
		// 退回
		sendConfirmBack() {
			let _this = this;
			if (this.submitSwitch.desc) {
				let param = {
					"workId": _this.workInfo.workId,
					"workType": _this.workInfo.workType,
					"workDesc": _this.workInfo.workDesc,
					"nodeDealStaffCode": _this.currentUser.userId,
					"nodeDealStaffName": _this.currentUser.name,
					"approveDes": _this.submitSwitch.desc,
					"nodeDealStaffRole": '1',
					"forwardNode": '1',
					"nodeVisibleRange": '20',
					"currentUser": _this.currentUser
				};
				console.log(JSON.stringify(param))
				mui.neiosRequst.httpRequst('/app/personWork/sendBack', param,
					(data) => {
						console.log(data)
						if (data.code == '0') {
							mui.toast("退回成功");
							setTimeout(this.goBack(), 500);
						}else{
							mui.toast(data.msg);
						}
					},
					(data) => {
						console.log(JSON.stringify(data))
						mui.toast("退回失败：");
					}
				);
			} else {
				mui.toast("请输入意见描述");
			}

		},
		//获取时间
		getTime(myDate, type) {
			var realYear = myDate.getFullYear();
			var myMonth = myDate.getMonth() + 1;
			var realMonth = myMonth;
			var myDay = myDate.getDate();
			var realDay = myDay;
			var myHour = myDate.getHours();
			var realHours = myHour;
			var myMinute = myDate.getMinutes();
			var realMinute = myMinute;
			var mySecond = myDate.getSeconds();
			var realSecond = mySecond;
			if (myMonth < 10) {
				realMonth = "0" + myMonth;
			}
			if (myDay < 10) {
				realDay = "0" + myDay;
			}
			if (myMinute < 10) {
				realMinute = "0" + myMinute;
			}
			if (myHour < 10) {
				realHours = "0" + myHour;
			}
			if (mySecond < 10) {
				realSecond = "0" + mySecond;
			}
			var realDate = realYear + '-' + realMonth + '-' + realDay + ' ' + realHours + ':' + realMinute + ':' +
				realSecond;
			if (type == "sec") {
				realDate = realYear + '-' + realMonth + '-' + realDay + ' ' + realHours + ':' + realMinute + ':' + realSecond;
			} else if (type == "min") {
				realDate = realYear + '-' + realMonth + '-' + realDay + ' ' + realHours + ':' + realMinute;
			} else if (type == "hour") {
				realDate = realYear + '-' + realMonth + '-' + realDay + ' ' + realHours;
			} else if (type == "day") {
				realDate = realYear + '-' + realMonth + '-' + realDay;
			} else if (type == "month") {
				realDate = realYear + '-' + realMonth;
			} else if (type == "year") {
				realDate = realYear;
			}
			return realDate;
		},
		navTo(e, data) {
			if (data) {
				window.localStorage.setItem("itme", JSON.stringify(data))
			} else {
				window.localStorage.setItem("itme", '')
			}
			mui.openWindow({
				url: e,
				id: 'my',
				extras: {
					'item': data
				},
				waiting: {
					autoShow: false
				}
			});
		},
		//保存安全设施检查
		save() {
			//整个表单的校验
			let _this = this;
			_this.safeCheck = _this.buildSaveParam(_this.safeCheck);
			_this.safeCheck.checkItems.map((va) => {
				_this.buildSaveParam(va)
				va.checkItemNotes.map((val) => {
					_this.buildSaveParam(val);
					_this.checkList.push(val);
				})
			});
			_this.checkList = _this.checkList.concat(_this.safeCheck.checkItems);
			let params = {
				"safeCheck": _this.safeCheck,
				"checkList": _this.checkList,
				"fileIds": _this.fileIds,
				"areaCompanyCode": _this.currentUser["companyNewCode"],
				"stationCode":  localStorage.getItem('neiosStationCode'),
			}
			console.log(JSON.stringify(params))
			mui.neiosRequst.httpRequst('/app/regularWork/safeDevice/saveOrUpdateSafeCheck', params,
				(data) => {
					if (data.code == '0') {
						mui.toast("保存成功");
						setTimeout(this.goBack(), 500);
					}
				},
				(data) => {
					mui.toast("保存失败：" + data.msg);
				}
			);
		},
		
		//提交
		submit() {
			let _this = this;
			let check = true
			if (!this.safeCheck.checkArea) {
				check = false
				mui.toast("请输入检查区域");
			}
			_this.safeCheck.checkItems.map(v => {
				v.checkItemNotes.map(val => {
					if (val.checkItemResult != '1') {
						if(val.checkItemResult=='0'){
							if (!val.problemLog) {
								mui.toast("请输入发现问题记录");
								check = false
							}
						}else{
							mui.toast("请勾选执行情况");
							check = false
						}
						
					}
				})
			})
			if (check) {
				_this.questionArrary = []
				_this.safeCheck.checkItems.map(v => {
					v.checkItemNotes.map(val => {
						if (val.checkItemResult == '0') {
							_this.questionArrary.push({
								name: `${v.checkItemContent}，检查内容：${val.checkItemContent}。不合格`,
								checkItemNoteId: val.checkItemNoteId
							});
						}
					})
				})
				_this.isApprove = true;
				_this.showDes = false;
				_this.showCheck = true;
				_this.backOrAgree = "submit";
			}
		},
		//通过
		pass() {
			this.questionArrary = []
			//工作项信息
			this.workInfo = {
				workId: this.parentObject.workId,
				workType: this.parentObject.workType,
				workDesc: "安全设施检查结束"
			};
			let _this = this;
			_this.safeCheck.checkItems.map(v => {
				v.checkItemNotes.map(val => {
					if (val.checkItemResult == '0') {
						_this.questionArrary.push({
							name: `${v.checkItemContent}，检查内容：${val.checkItemContent}。不合格`
						});
					}
				})
			})
			this.isApprove = true;
			this.showDes = true;
			this.showCheck = false;
			this.backOrAgree = "pass";
		},
		//退回
		sendBack() {
			this.questionArrary = []
			//工作项信息
			this.workInfo = {
				workId: this.parentObject.workId,
				workType: this.parentObject.workType,
				workDesc: "按检查项目对安全设施进行检查并提交检查结果"
			};
			let _this = this;
			_this.safeCheck.checkItems.map(v => {
				v.checkItemNotes.map(val => {
					if (val.checkItemResult == '0') {
						_this.questionArrary.push({
							name: `${v.checkItemContent}，检查内容：${val.checkItemContent}。不合格`
						});
					}
				})
			})
			this.isApprove = true;
			this.showCheck = false;
			this.showDes = true;
			this.backOrAgree = "back";
		},
		//构建保存场电切换添加对象
		buildSaveParam(safeCheck) {
			safeCheck.status = "21";
			safeCheck.dataStatus = "1";
			safeCheck.dataSource = "NEIOS_APP"+localStorage.getItem("currVersion");
			safeCheck.client = "NEIOS";
			safeCheck.createBy = this.currentUser["userId"];
			safeCheck.createStaffName = this.currentUser["name"];
			safeCheck.modifyBy = this.currentUser["userId"];
			safeCheck.modifyStaffName = this.currentUser["name"];
			return safeCheck;
		},
		// 关闭弹窗
		clearDefectInfo() {
			this.showAdd = false
		},
		getName(data) {
			if (data) {
				let list = []
				data.split(',').map((v) => {
					list.push(v.split(']')[1])
				})
				return list.join(',');
			} else {
				return data
			}

		},
		//返回上一页
		goBack() {
			let page2 = plus.webview.getWebviewById("../sitOperation/terminalwork/terminalwork.html");
			let param = {}
			param.isRefresh = true
			mui.fire(page2, 'isRefresh', param);
			mui.back()
		},
		//新巡视人若编辑了历史信息则对应巡视人为新巡视人否则保持为原巡视人
		// changeCheck() {
		// 	this.formData.checkStaffCode = this.currentUser['userId'];
		// 	this.formData.checkStaffName = this.currentUser['name'];
		// 	this.formData.checkStaffCodeName = this.currentUser['userName'];
		// },
		//点击菜单
		menuClick(e) {
			this.navTo(e.path)

		},
		// 上傳
		upload() {
			let that = this
			mui.neiosCommon.doUploads(function(ret) {
				if ("0" == ret.code) {
					console.log("成功：" + JSON.stringify(ret))
					// mui.toast('文件'+ret.data.fileName+"上传成功");
					that.fileIds == "" ? that.fileIds += ret.data.fileId : that.fileIds += "," + ret.data.fileId;
					that.getFileds()
				} else {
					mui.toast('文件上传失败');
				}
			}, function(err) {
				mui.toast('文件上传失败');
			})
		},
		// 删除文件
		delDown(data){
			let myFileIds = this.fileIds.split(',')
			console.log(JSON.stringify(myFileIds))
			myFileIds.forEach((item,i)=>{
				if(item == data.fileId){
					myFileIds.splice(i,1)
				}
			})
			this.fileIds = myFileIds.join(',')
			console.log(this.fileIds)
			this.getFileds()
		},
		// 获取文件列表
		getFileds(){
			mui.neiosRequst.httpRequst('/app/common/getFileList', {fileIds:this.fileIds},
				(data) => {
					if (data.code == '0') {
						console.log(JSON.stringify(data.data))
						this.filesList = data.data
					} else {
						mui.toast("获取失败：" + data.msg);
					}
				},
				(data) => {
					mui.toast("退回失败：" + data.msg);
				}
			);
		},
		// 下载
		downLoad(data) {
			let url = "/app/common/downloadFile";
			let param = {};
			param.fileId = data.fileId;
			mui.neiosCommon.downLoadFile(param, function(ret) {
				mui.plusReady(function() {
					plus.nativeUI.closeWaiting();
				})
				//调用存储
				var callbackID = plus.bridge.callbackId(function(ret) {
					mui.toast(ret[0])
				}, function(err) {
					mui.toast('文件下载失败')
				});
				plus.bridge.execSync("FileHelper", "doFileSave", [callbackID, ret, data.fileName, "Argus3", "Argus4"])
			}, function(err) {
				mui.plusReady(function() {
					plus.nativeUI.closeWaiting();
				})
				mui.toast('文件下载失败')
			});
		},
		//左上角菜单显示隐藏
		showMenulist() {
			this.showMenu ? this.showMenu = false : this.showMenu = true
		},
	}

})



// mui.init({
// 	pullRefresh: {
// 		container: "#scroll", //待刷新区域标识，querySelector能定位的css选择器均可，比如：id、.class等
// 		down: { //下拉刷新
// 			style: 'circle',
// 			height: 50, //可选,默认50.触发下拉刷新拖动距离,
// 			auto: false, //可选,默认false.首次加载自动下拉刷新一次
// 			contentdown: "下拉可以刷新", //可选，在下拉可刷新状态时，下拉刷新控件上显示的标题内容
// 			contentover: "释放立即刷新", //可选，在释放可刷新状态时，下拉刷新控件上显示的标题内容
// 			contentrefresh: "正在刷新...", //可选，正在刷新状态时，下拉刷新控件上显示的标题内容
// 			callback: async function() { //必选，刷新函数，根据具体业务来编写，比如通过ajax从服务器获取新数据；
// 				page = 0;

// 				////没有更多内容了，endPulldown 传入true， 不再执行下拉刷新
// 				mui('#scroll').pullRefresh().endPulldownToRefresh();
// 				mui('#scroll').pullRefresh().enablePullupToRefresh();
// 				mui('#scroll').pullRefresh().endPullupToRefresh(true);
// 			}
// 		},
// 		up: { //上拉加载
// 			height: 50, //可选.默认50.触发上拉加载拖动距离
// 			auto: false, //可选,默认false.自动上拉加载一次
// 			contentrefresh: "正在加载...", //可选，正在加载状态时，上拉加载控件上显示的标题内容
// 			contentnomore: '没有更多数据了', //可选，请求完毕若没有更多数据时显示的提醒内容；
// 			callback: async function() { //必选，刷新函数，根据具体业务来编写，比如通过ajax从服务器获取新数据；

// 			}
// 		}
// 	}
// });
